﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;

namespace FreedomX2.Core.Transport.SocketProvider
{
    public partial class FrmSocketChoose : Form
    {
        public FrmSocketChoose()
        {
            InitializeComponent();
        }
        public string Result { get; set; }
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            Result = listBox1.SelectedItem.ToString();

        }

        private void FrmSocketChoose_Load(object sender, EventArgs e)
        {
            IPHostEntry hostEntry = Dns.GetHostEntry(Dns.GetHostName());
            hostEntry.AddressList.ToList().ForEach(a =>
            {
                listBox1.Items.Add(a.ToString());
            });
        }
    }
}
